

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="${grailsApplication.config.gk.layout}" />
        <title>Edit Profile</title>
    </head>
    <body>
        <div class="body">
            <h1>Edit Profile</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${profile}">
            <div class="errors">
                <g:renderErrors bean="${profile}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" enctype="multipart/form-data" >
                <input type="hidden" name="id" value="${profile?.id}" />
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                </div>

                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="displayName">Display Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:gprofile,field:'displayName','errors')}">
                                    <input type="text" id="displayName" name="displayName" value="${gprofile.displayName}"/>

                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="imageName">Image:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:gprofile,field:'imageName','errors')}">
				<input type='file' id='imageFile' name='imageFile' /><br/>
                                  <g:if test="${gprofile.imageName}">
                                          ${gprofile.imageTag()}
                                  </g:if>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="homepageUri">URL:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:profile,field:'homepageUri','errors')}">
                                    <input type="text" id="homepageUri" name="homepageUri" value="${gprofile.homepageUri}"/>

                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="location">Location:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:gprofile,field:'location','errors')}">
                                    <input type="text" id="location" name="location" value="${gprofile.location}"/>

                                </td>
                            </tr>


                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="address">Address:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:profile,field:'address','errors')}">
                                    <input type="text" id="address" name="address" value="${gprofile.address}"/>

                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="city">City:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:profile,field:'city','errors')}">
                                    <input type="text" id="city" name="city" value="${gprofile.city}"/>

                                </td>
                            </tr> 

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="state">State:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:profile,field:'state','errors')}">
                                    <input type="text" id="state" name="state" value="${gprofile.state}"/>

                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="postcode">ZIP / Postcode:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:profile,field:'postcode','errors')}">
                                    <input type="text" id="postcode" name="postcode" value="${gprofile.postcode}"/>

                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="country">Country:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:profile,field:'country','errors')}">
                                    <input type="text" id="country" name="country" value="${gprofile.country}"/>

                                </td>
                            </tr> 
                        
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="phoneNumber">Phone Number:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:profile,field:'phoneNumber','errors')}">
                                    <input type="text" id="phoneNumber" name="phoneNumber" value="${gprofile.phoneNumber}"/>

                                </td>
                            </tr> 
                        
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
